<?php


 /**
  * Ticket Value Object.
  * This class is value object representing database table Ticket
  * This class is intented to be used together with associated Dao object.
  */


class Ticket {

    /**
     * Persistent Instance variables. This data is directly
     * mapped to the columns of database table.
     */
    var $TicketID;
    var $CustomerID;
    var $CurrentEmpAssigned;
    var $ExpectCmpltDate;



    /**
     * Constructors.
     * The first one takes no arguments and provides the most simple
     * way to create object instance. The another one takes one
     * argument, which is the primary key of the corresponding table.
     */

    function Ticket () {

    }

    /* function Ticket ($TicketIDIn) {

          $this->TicketID = $TicketIDIn;

    } */


    /**
     * Get- and Set-methods for persistent variables. The default
     * behaviour does not make any checks against malformed data,
     * so these might require some manual additions.
     */

    function getTicketID() {
          return $this->TicketID;
    }
    function setTicketID($TicketIDIn) {
          $this->TicketID = $TicketIDIn;
    }

    function getCustomerID() {
          return $this->CustomerID;
    }
    function setCustomerID($CustomerIDIn) {
          $this->CustomerID = $CustomerIDIn;
    }

    function getCurrentEmpAssigned() {
          return $this->CurrentEmpAssigned;
    }
    function setCurrentEmpAssigned($CurrentEmpAssignedIn) {
          $this->CurrentEmpAssigned = $CurrentEmpAssignedIn;
    }

    function getExpectCmpltDate() {
          return $this->ExpectCmpltDate;
    }
    function setExpectCmpltDate($ExpectCmpltDateIn) {
          $this->ExpectCmpltDate = $ExpectCmpltDateIn;
    }



    /**
     * setAll allows to set all persistent variables in one method call.
     * This is useful, when all data is available and it is needed to
     * set the initial state of this object. Note that this method will
     * directly modify instance variales, without going trough the
     * individual set-methods.
     */

    function setAll($TicketIDIn,
          $CustomerIDIn,
          $CurrentEmpAssignedIn,
          $ExpectCmpltDateIn) {
          $this->TicketID = $TicketIDIn;
          $this->CustomerID = $CustomerIDIn;
          $this->CurrentEmpAssigned = $CurrentEmpAssignedIn;
          $this->ExpectCmpltDate = $ExpectCmpltDateIn;
    }


    /**
     * hasEqualMapping-method will compare two Ticket instances
     * and return true if they contain same values in all persistent instance
     * variables. If hasEqualMapping returns true, it does not mean the objects
     * are the same instance. However it does mean that in that moment, they
     * are mapped to the same row in database.
     */
    function hasEqualMapping($valueObject) {

          if ($valueObject->getTicketID() != $this->TicketID) {
                    return(false);
          }
          if ($valueObject->getCustomerID() != $this->CustomerID) {
                    return(false);
          }
          if ($valueObject->getCurrentEmpAssigned() != $this->CurrentEmpAssigned) {
                    return(false);
          }
          if ($valueObject->getExpectCmpltDate() != $this->ExpectCmpltDate) {
                    return(false);
          }

          return true;
    }



    /**
     * toString will return String object representing the state of this
     * valueObject. This is useful during application development, and
     * possibly when application is writing object states in textlog.
     */
    function toString() {
        $out = $out."\nclass Ticket, mapping to table Ticket\n";
        $out = $out."Persistent attributes: \n";
        $out = $out."TicketID = ".$this->TicketID."\n";
        $out = $out."CustomerID = ".$this->CustomerID."\n";
        $out = $out."CurrentEmpAssigned = ".$this->CurrentEmpAssigned."\n";
        $out = $out."ExpectCmpltDate = ".$this->ExpectCmpltDate."\n";
        return $out;
    }


    /**
     * Clone will return identical deep copy of this valueObject.
     * Note, that this method is different than the clone() which
     * is defined in java.lang.Object. Here, the retuned cloned object
     * will also have all its attributes cloned.
     */
    function clone1() {
        $cloned = new Ticket();

        $cloned->setTicketID($this->TicketID);
        $cloned->setCustomerID($this->CustomerID);
        $cloned->setCurrentEmpAssigned($this->CurrentEmpAssigned);
        $cloned->setExpectCmpltDate($this->ExpectCmpltDate);

        return $cloned;
    }


}

?>